# 电视为A类
class TV:
    def turn_on(self):
        print("TV turned on")

    def turn_off(self):
        print("TV turned off")

    def change_channel(self, channel):
        print(f"Changed to channel: {channel}")

# 遥控器为B类
# 遥控器不是电视的组成部分，但是电视的换台、打开电视机等功能需要依靠遥控器按钮来实现
class RemoteControl:
    def __init__(self, tv):
        self.tv = tv

    def press_power_button(self, action):
        if action == "on":
            self.tv.turn_on()
        elif action == "off":
            self.tv.turn_off()

    def press_channel_button(self, channel):
        self.tv.change_channel(channel)

my_tv = TV()
my_remote = RemoteControl(my_tv)
my_remote.press_power_button("on")
my_remote.press_channel_button(5)